<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="text" name="" id="e">
    <select id="sel">
        <option value="+">+</option>
        <option value="-">-</option>
        <option value="*">*</option>
        <option value="/">/</option>
        <option value="%">%</option>
    </select>
    <input type="text" name="" id="ee">
    <button id="btn">=</button>
    <span id="eee"></span>
    <script>
        var e = document.getElementById('e')
        var ee = document.getElementById('ee')
        var eee = document.getElementById('eee')
        var btn = document.getElementById('btn')
        var select = document.getElementById('sel')
        var index = select.selectedIndex
        var selectedv = select.options[index].text
        btn.onclick = function () {
            index = select.selectedIndex
            selectedv = select.options[index].text
            console.log(selectedv)
            switch (selectedv) {
                case '+':
                    ev = Number(e.value)
                    eev = Number(ee.value)
                    eee.innerText = ev + eev
                    break
                case '-':
                    ev = Number(e.value)
                    eev = Number(ee.value)
                    eee.innerText = ev - eev
                    break
                case '*':
                    ev = Number(e.value)
                    eev = Number(ee.value)
                    eee.innerText = ev * eev
                    break
                case '/':
                    ev = Number(e.value)
                    eev = Number(ee.value)
                    eee.innerText = ev / eev
                    break
                case '%':
                    ev = Number(e.value)
                    eev = Number(ee.value)
                    eee.innerText = ev % eev
            }
        }
    </script>
</body>

</html>